#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
	int n = 0;
	char arr[14] = { 0 };
	scanf("%d", &n);
	int i = 0;
	int k = 0;
	while (n) {
		if (k != 0 && k % 3 == 0) {
			arr[i++] = ',';
		}
		arr[i++]=n % 10 + '0';
		n /= 10;
		k++;
	}
	for (i--; i >= 0; i--) {
		printf("%c", arr[i]);
	}
	return 0;
}